package com.db4o.odbgen.plugins;

import java.util.List;
import java.util.Properties;

import com.db4o.odbgen.OdbGen;
import com.db4o.odbgen.OdbgenException;
import com.db4o.odbgen.plugins.xmlschema.XmlSchema;

/**
 * 
 * The MainGenerator plugin is the root of all plugins.
 * It's job is to generate the files and to provide events and support for higher level plugins.
 * @author liviug
 */
public interface MainGeneratorPlugin {

    /**
     * Used to initialize the plugin.
     * @param odbGen The instance of OdbGen that uses this plugin.
     * @param xmlSchema The XmlSchema used to generate code.
     * @param pluginStack The list of plugins in the stack.
     * It must be sorted by dependencies. A plugin is closer to the head of the list if there
     * are more pllugins that depend on it. A plugin is at the end of th elist if
     * there are less plugins depending on it.
     * This list contains all plugins, including the main generator.
     */
    void initializeMainGenerator(OdbGen odbGen, XmlSchema xmlSchema, List<Plugin> pluginStack ) throws OdbgenException;
    
    /**
     * Returns the current options.
     */
    Properties getOptions();
    
    /**
     * Use this to start code generation.
     * @throws OdbgenException In case the code generation failed. 
     */
    void start() throws OdbgenException;
    
    
}


